home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / PInterfaces / Folders.p < prev    next >
Encoding:
Text File  |  1996-05-01  |  7.5 KB  |  215 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Folders.p
  3.  
  4.      Contains:    Folder Manager Interfaces.
  5.  
  6.      Version:    Technology:    Some
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Folders;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __FOLDERS__}
  28. {$SETC __FOLDERS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC FoldersIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __CODEFRAGMENTS__}
  38. {$I CodeFragments.p}
  39. {$ENDC}
  40. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  41. {$IFC UNDEFINED __FILEMANAGERTYPES__}
  42. {$I FileManagerTypes.p}
  43. {$ENDC}
  44. {$ENDC}
  45.  
  46. {$PUSH}
  47. {$ALIGN MAC68K}
  48. {$LibExport+}
  49.  
  50. {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE }
  51.  
  52. CONST
  53.     kOnSystemDisk                = $8000;
  54.     kCreateFolder                = 1;
  55.     kDontCreateFolder            = 0;
  56.     kSystemFolderType            = 'macs';                        {  the system folder  }
  57.     kDesktopFolderType            = 'desk';                        {  the desktop folder; objects in this folder show on the desk top.  }
  58.     kTrashFolderType            = 'trsh';                        {  the trash folder; objects in this folder show up in the trash  }
  59.     kWhereToEmptyTrashFolderType = 'empt';                        {  the "empty trash" folder; Finder starts empty from here down  }
  60.     kPrintMonitorDocsFolderType    = 'prnt';                        {  Print Monitor documents  }
  61.     kStartupFolderType            = 'strt';                        {  Finder objects (applications, documents, DAs, aliases, to...) to open at startup go here  }
  62.     kShutdownFolderType            = 'shdf';                        {  Finder objects (applications, documents, DAs, aliases, to...) to open at shutdown go here  }
  63.     kAppleMenuFolderType        = 'amnu';                        {  Finder objects to put into the Apple menu go here  }
  64.     kControlPanelFolderType        = 'ctrl';                        {  Control Panels go here (may contain INITs)  }
  65.     kExtensionFolderType        = 'extn';                        {  Finder extensions go here  }
  66.     kFontsFolderType            = 'font';                        {  Fonts go here  }
  67.     kPreferencesFolderType        = 'pref';                        {  preferences for applications go here  }
  68.     kTemporaryFolderType        = 'temp';                        {  temporary files go here (deleted periodically, but don't rely on it.)  }
  69.  
  70. FUNCTION FindFolder(vRefNum: INTEGER; folderType: OSType; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): OSErr;
  71.     {$IFC NOT GENERATINGCFM}
  72.     INLINE $7000, $A823;
  73.     {$ENDC}
  74. FUNCTION ReleaseFolder(vRefNum: INTEGER; folderType: OSType): OSErr;
  75.     {$IFC NOT GENERATINGCFM}
  76.     INLINE $700B, $A823;
  77.     {$ENDC}
  78. {$ENDC}
  79. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  80. { **************************************** }
  81. {  Extensible Folder Manager declarations  }
  82. { **************************************** }
  83. { ************************** }
  84. {  Folder Manager constants  }
  85. { ************************** }
  86. {  new gestalt constants for gestalt FindFolderAttr (to be moved to Gestalt.h)  }
  87.  
  88. CONST
  89.     gestaltFolderDescSupport    = 1;                            {  has FolderDesc calls  }
  90.  
  91. {  new Folder Manager error codes  }
  92.     badFolderDescErr            = -4270;
  93.     duplicateFolderDescErr        = -4271;
  94.     noMoreFolderDescErr            = -4272;
  95.     invalidFolderTypeErr        = -4273;
  96.     duplicateRoutingErr            = -4274;
  97.     routingNotFoundErr            = -4275;
  98.     badRoutingSizeErr            = -4276;
  99.  
  100.     kExtensionDisabledFolderType = 'extD';
  101.     kControlPanelDisabledFolderType = 'ctrD';
  102.     kSystemExtensionDisabledFolderType = 'macD';
  103.     kApplicationsFolderType        = 'apps';
  104.     kDocumentsFolderType        = 'docs';
  105.  
  106.                                                                 {  new constants  }
  107.     kVolumeRootFolderType        = 'root';                        {  root folder of a volume  }
  108.     kGlobalPreferencesFolderType = 'gprf';                        {  preferences for all users/workspaces  }
  109.     kChewableItemsFolderType    = 'flnt';                        {  items deleted at boot  }
  110.     kApplicationSupportFolderType = 'asup';                        {  third-party items and folders  }
  111.     kSystem7SystemFolderType    = 'ƒblu';                        {  System 7 system folder  }
  112.     kDebuggerExtensionsFolderType = 'ƒdeb';                        {  debugger extensions  }
  113.     kDesktopModulesFolderType    = 'ƒdsk';                        {  desktop animation modules  }
  114.     kEditorsFolderType            = 'ƒedi';                        {  OpenDoc editors  }
  115.     kExtensionLibrariesFolderType = 'ƒexl';                        {  leechlets  }
  116.     kCoopExtensionLibrariesFolderType = 'ƒcex';                    {  blue leechlets  }
  117.     kHardwareSupportFolderType    = 'ƒhdw';                        {  hardware support  }
  118.     kLocalesFolderType            = 'ƒloc';                        {  locales  }
  119.     kServerLibrariesFolderType    = 'ƒser';                        {  servers  }
  120.     kSystemLibrariesFolderType    = 'ƒsys';                        {  system libraries  }
  121.     kTextEncodingsFolderType    = 'ƒtex';                        {  encoding tables  }
  122.     kThemesFolderType            = 'ƒthm';                        {  themes  }
  123.     kStationeryFolderType        = 'ƒstn';                        {  stationery  }
  124.  
  125. {  FolderDescFlags values  }
  126.     kPersistentFolderDesc        = $00000001;
  127.     kCreateFolderAtBoot            = $00000002;
  128.     kFolderCreatedInvisible        = $00000004;
  129.     kFolderCreatedNameLocked    = $00000008;
  130.  
  131.  
  132. TYPE
  133.     FolderDescFlags                        = UInt32;
  134. {  FolderClass values  }
  135.  
  136. CONST
  137.     kRelativeFolder                = 'relf';
  138.     kSpecialFolder                = 'spcf';
  139.  
  140.  
  141. TYPE
  142.     FolderClass                            = OSType;
  143.  
  144. CONST
  145.     doReplace                    = 1;
  146.     dontReplace                    = 0;
  147.  
  148. {  known FolderType values  }
  149.     kBlessedFolder                = 'blsf';
  150.     kCurrentWorkspaceFolder        = 'cwsf';
  151.     kRootFolder                    = 'rotf';
  152.     kWorkspacesFolder            = 'wksf';
  153.  
  154.  
  155. TYPE
  156.     FolderType                            = OSType;
  157.     FolderLocation                        = OSType;
  158.     FolderDescPtr = ^FolderDesc;
  159.     FolderDesc = RECORD
  160.         descSize:                Size;
  161.         foldType:                FolderType;
  162.         flags:                    FolderDescFlags;
  163.         foldClass:                FolderClass;
  164.         foldLocation:            FolderType;
  165.         badgeSignature:            OSType;
  166.         badgeType:                OSType;
  167.         reserved:                UInt32;
  168.         name:                    Str63;
  169.     END;
  170.  
  171.     RoutingFlags                        = UInt32;
  172.     FolderRoutingPtr = ^FolderRouting;
  173.     FolderRouting = RECORD
  174.         descSize:                Size;
  175.         fileType:                OSType;
  176.         routeFromFolder:        FolderType;
  177.         routeToFolder:            FolderType;
  178.         flags:                    RoutingFlags;
  179.     END;
  180.  
  181. {  routing constants  }
  182.  
  183. CONST
  184.     kPersistentRouting            = $00000001;
  185.  
  186. { ************************* }
  187. {  Folder Manager routines  }
  188. { ************************* }
  189. {  Folder Manager administration routines  }
  190. FUNCTION AddFolderDescriptor(foldType: FolderType; flags: FolderDescFlags; foldClass: FolderClass; foldLocation: FolderLocation; badgeSignature: OSType; badgeType: OSType; VAR name: Str63; replaceFlag: BOOLEAN): OSErr;
  191. FUNCTION GetFolderDescriptor(foldType: FolderType; descSize: Size; VAR foldDesc: FolderDesc): OSErr;
  192. FUNCTION GetFolderTypes(requestedTypeCount: UInt32; VAR totalTypeCount: UInt32; VAR theTypes: FolderType): OSErr;
  193. FUNCTION RemoveFolderDescriptor(foldType: FolderType): OSErr;
  194. FUNCTION FindFolderFSObject(foldType: FolderType; createFolder: BOOLEAN; VAR objectRef: FSObjectRef): OSErr;
  195. FUNCTION NewFindFolder(vRefNum: INTEGER; foldType: FolderType; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): OSErr;
  196. FUNCTION InvalidateFolderDescriptorCache(vRefNum: INTEGER; dirID: LONGINT): OSErr;
  197. {  legacy routines  }
  198. FUNCTION GetFolderName(vRefNum: INTEGER; foldType: OSType; VAR foundVRefNum: INTEGER; name: StringPtr): OSErr;
  199. {  routing routines  }
  200. FUNCTION AddFolderRouting(fileType: OSType; routeFromFolder: FolderType; routeToFolder: FolderType; flags: RoutingFlags; replaceFlag: BOOLEAN): OSErr;
  201. FUNCTION RemoveFolderRouting(fileType: OSType; routeFromFolder: FolderType): OSErr;
  202. FUNCTION FindFolderRouting(fileType: OSType; routeFromFolder: FolderType; VAR routeToFolder: FolderType; VAR flags: RoutingFlags): OSErr;
  203. FUNCTION GetFolderRoutings(requestedRoutingCount: UInt32; VAR totalRoutingCount: UInt32; routingSize: Size; VAR theRoutings: FolderRouting): OSErr;
  204. {$ENDC}
  205. {$ALIGN RESET}
  206. {$POP}
  207.  
  208. {$SETC UsingIncludes := FoldersIncludes}
  209.  
  210. {$ENDC} {__FOLDERS__}
  211.  
  212. {$IFC NOT UsingIncludes}
  213.  END.
  214. {$ENDC}
  215.